/*
 * DIM-SUM操作系统 - 网络头文件
 *
 * Copyright (C) 2023 国科础石(重庆)软件有限公司
 *
 * 作者: Dong Peng <w-pengdong@kernelsoft.com>
 *       Jingchen Zhong <zhongjingchen@kernelsoft.com>
 *
 * License terms: GNU General Public License (GPL) version 3
 *
 */

#ifndef __ASM_ARM64_CHECKSUM_H
#define __ASM_ARM64_CHECKSUM_H

typedef __u16 __bitwise __sum16;                                                                                    
typedef __u32 __bitwise __wsum;

/**
 * 计算缓冲区的校验和
 */
__wsum csum_partial(const void *buff, int len, __wsum wsum);
__sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
		                    unsigned short proto, __wsum sum);
__sum16 ip_compute_csum(const void *buff, int len);
__sum16 ip_fast_csum(const void *iph, unsigned int ihl);
__wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,                                                               
             unsigned short len,
             unsigned short proto,
             __wsum sum);
__sum16 csum_fold(__wsum csum);

#endif /* __ASM_ARM64_CHECKSUM_H */